<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>JSONType</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">JSONType()</font></b></p>
<p><b>语法</b></p><blockquote>

Result = <font color="#3A3966"><b>JSONType</b></font>(JSONValue)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Returns the type of the given JSON value. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>JSONValue</i></td>
<td width="90%"> 
 
The JSON value. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



It can be one of the following: 
<br>
<br>

<font color="#924B72">#PB_JSON_Null</font> 
<blockquote>



The value represents the JSON literal null. 
 
</blockquote>


<font color="#924B72">#PB_JSON_String</font> 
<blockquote>



The value contains a string. <a href="getjsonstring.html">GetJSONString()</a> can be used to read the string. 
 
</blockquote>


<font color="#924B72">#PB_JSON_Number</font> 
<blockquote>



The value contains a number. <a href="getjsondouble.html">GetJSONDouble()</a>, <a href="getjsonfloat.html">GetJSONFloat()</a>, <a href="getjsoninteger.html">GetJSONInteger()</a> or 
<a href="getjsonquad.html">GetJSONQuad()</a> can be used to read the number. 
 
</blockquote>


<font color="#924B72">#PB_JSON_Boolean</font> 
<blockquote>



The value contains a boolean. <a href="getjsonboolean.html">GetJSONBoolean()</a> can be used to read the value. 
 
</blockquote>


<font color="#924B72">#PB_JSON_Array</font> 
<blockquote>



The value contains an array of JSON elements. <a href="jsonarraysize.html">JSONArraySize()</a> returns the size 
of the array. <a href="getjsonelement.html">GetJSONElement()</a> can be used to get a specific array element. 
<a href="addjsonelement.html">AddJSONElement()</a>, <a href="removejsonelement.html">RemoveJSONElement()</a>, <a href="resizejsonelements.html">ResizeJSONElements()</a> or 
<a href="clearjsonelements.html">ClearJSONElements()</a> can be used to modify the array. 
 
</blockquote>


<font color="#924B72">#PB_JSON_Object</font> 
<blockquote>



The value contains an object (a set of key/value pairs). <a href="jsonobjectsize.html">JSONObjectSize()</a> returns the 
number of menbers in the object. <a href="getjsonmember.html">GetJSONMember()</a> returns a specific member value. 
<a href="examinejsonmembers.html">ExamineJSONMembers()</a> can be used to examine the member values. 
<a href="addjsonmember.html">AddJSONMember()</a>, <a href="removejsonmember.html">RemoveJSONMember()</a> or <a href="clearjsonmembers.html">ClearJSONMembers()</a> can be used to modify the object. 
 
</blockquote>


</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">  <font color="#3A3966">; A procedure that accepts any JSON value and returns a string</font>
  <font color="#3A3966">;</font>
  <b><font color="#3A3966">Procedure</font></b>.s <font color="#3A3966">GetAnyValue</font>(Value)
    <b><font color="#3A3966">Select</font></b> <font color="#3A3966">JSONType</font>(Value)
      <b><font color="#3A3966">Case</font></b> <font color="#924B72">#PB_JSON_Null</font>:    <b><font color="#3A3966">ProcedureReturn</font></b> "null"
      <b><font color="#3A3966">Case</font></b> <font color="#924B72">#PB_JSON_String</font>:  <b><font color="#3A3966">ProcedureReturn</font></b> <font color="#3A3966">GetJSONString</font>(Value)
      <b><font color="#3A3966">Case</font></b> <font color="#924B72">#PB_JSON_Number</font>:  <b><font color="#3A3966">ProcedureReturn</font></b> <font color="#3A3966">StrD</font>(<font color="#3A3966">GetJSONDouble</font>(Value))    
      <b><font color="#3A3966">Case</font></b> <font color="#924B72">#PB_JSON_Boolean</font>: <b><font color="#3A3966">ProcedureReturn</font></b> <font color="#3A3966">Str</font>(<font color="#3A3966">GetJSONBoolean</font>(Value))
      <b><font color="#3A3966">Case</font></b> <font color="#924B72">#PB_JSON_Array</font>:   <b><font color="#3A3966">ProcedureReturn</font></b> "array"
      <b><font color="#3A3966">Case</font></b> <font color="#924B72">#PB_JSON_Object</font>:  <b><font color="#3A3966">ProcedureReturn</font></b> "object"
    <b><font color="#3A3966">EndSelect</font></b>
  <b><font color="#3A3966">EndProcedure</font></b>
  
<font color="#3A3966">  ParseJSON</font>(0, "[1, 2, true, null, " +<font color="#3A3966"> Chr</font>(34) + "hello" +<font color="#3A3966"> Chr</font>(34) + "]")
  <b><font color="#3A3966">For</font></b> i = 0 <b><font color="#3A3966">To</font></b> <font color="#3A3966">JSONArraySize</font>(<font color="#3A3966">JSONValue</font>(0)) - 1
    <b><font color="#3A3966">Debug</font></b> <font color="#3A3966">GetAnyValue</font>(<font color="#3A3966">GetJSONElement</font>(<font color="#3A3966">JSONValue</font>(0), i))
  <b><font color="#3A3966">Next</font></b> i
</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="jsonvalue.html">JSONValue()</a>, <a href="setjsonarray.html">SetJSONArray()</a>, <a href="setjsonboolean.html">SetJSONBoolean()</a>, <a href="setjsondouble.html">SetJSONDouble()</a>, 
<a href="setjsonfloat.html">SetJSONFloat()</a>, <a href="setjsoninteger.html">SetJSONInteger()</a>, <a href="setjsonnull.html">SetJSONNull()</a>, 
<a href="setjsonobject.html">SetJSONObject()</a>, <a href="setjsonstring.html">SetJSONString()</a>, <a href="setjsonquad.html">SetJSONQuad()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=jsonobjectsize.html>JSONObjectSize()</a> - <a href="index.html">Json Index</a> - <a href="jsonvalue.html">JSONValue()</a> -&gt;<br><br>

</body></html>